The present invention relates to methods of correcting a program in a computer system, and more particularly to a method of correcting a program which resides always on a main storage of a computer system which is difficult to stop.
As a method of correcting a program in a computer system, there is a method of rewriting a program in its entirety in the computer system by reloading a corrected program. A method of correcting a program in a computer system without reloading such a program is disclosed in JP-A-3-97030 entitled xe2x80x9cPROGRAM CORRECTING SYSTEMxe2x80x9d in which a correcting program provided beforehand in the computer system is replaced with a program to be corrected.
Correction to a program having a reentrant structure constructed such that two or more tasks can be used simultaneously, which is an object of the present invention, by reloading a corrected program has been found impractical because it requires much labor for initialization in the reloading of the corrected program. The method of correcting a program by replacing a correcting program provided beforehand in the computer system with a program to be corrected has the following problems. For a program having a reentrant structure such as that of the present invention, it has been found that there is a danger that a program may run by another command processor in the course of its correction, which should be avoided. It has also been found desirable even in such a case to minimize the time in which the running of the program has been avoided to thereby minimize the influence on the availability factor of the system.
It is therefore an object of the present invention to provide a program correcting method and system which corrects a program which resides always in a main storage which a plurality of command processors can call simultaneously without reloading a corrected program and running a program in the course of correction and minimizes the stop time of the system due to avoidance of such running of the program.
In order to achieve this object, the present invention provides a method of correcting a program in a computer system which includes in combination a plurality of command processors, a main storage, a command unit for commanding correction to a program and an external storage which information to correct the program is stored, the program being callable by a plurality of the command processors. In this method, program correction information including at least a correction place and content of a program is fetched in accordance with a command for correction to the program. A command processor which executes correction to the program is designated from among the plurality of command processors. Correction execution declaration information is set in all subareas of the correction execution declaration area for the plurality of command processors other than its subarea for the designated command processor IPm in accordance with a command from the designated command processor IPm. The respective command processors other than the designated one IPm determine whether correction execution declaration information is been set in corresponding subareas of the correction execution declaration area for the respective command processors in accordance with an instruction from a program, to be corrected, which the respective command processors have called. If so, they clear the correction execution declaration information. In addition, they determine whether correction completion reporting information has been set in the corresponding subareas of the correction completion reporting area of the main storage, and iterate this determination until the corresponding completion reporting information is set. Thereafter, subsequently, they determine repeatedly whether all the correction execution declaration information in the subareas of the correction execution declaration area other than that for the IPm has been cleared. If so, they execute correction to the program, to be corrected,in accordance with the correction information. When the correction to the program ends, they set correction completion reporting information in all the subareas of the correction execution declaration area of the main storage except for the subarea for its designated command processor to thereby correct the program.
According to such method, after correction execution declaration information has been set in correction execution declaration areas of command processors other than a command processor IPm, each IP other than the IPm clears the corresponding correction execution declaration information. After all the correction execution declaration have been cleared, the program is then corrected on the basis of the program correction information. Correction completion report information is set in each of the correction completion reporting areas of the command processors other than the IPm. The respective command processors other than IPm repeatedly check whether the correction completion reporting information has been set in the corresponding correction completion reporting area and clears it, if any. When the correction completion reporting information in all the correction completion reporting areas has been cleared, the corrected program is sent to the external storage and stored therein, and the respective command processors other than the IPm repeatedly check the setting of the correction completion reporting information in the corresponding correction completion reporting areas, thus, the running of the program by the respective command processors is avoided.